<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-basics-edit" th:object="${basics}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">直购电用户：</label>
				<div class="col-sm-8">
					<select class="form-control m-b" id="userId"  name="userId">
						<option th:each="user : ${users}" th:text="${user.name}" th:value="${user.id}" th:field="*{userId}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">录入次数：</label>
				<div class="col-sm-8">
					<input id="name" name="name" th:field="*{name}" class="form-control" type="number">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">电费月份：</label>
				<div class="col-sm-8">
					<input type="text"  class="time-input form-control" id="resultDate" th:value="${#dates.format(basics.resultDate,'yyyy-MM-dd')}" placeholder="统计日期" name="resultDate"/>
				</div>
				<!--<div class="col-sm-8">-->
					<!--<input id="resultDate" name="resultDate" th:field="*{resultDate}" class="form-control" type="text">-->
				<!--</div>-->
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">电压等级：</label>
				<div class="col-sm-8">
					<!--<input id="voltageGrade" name="voltageGrade" th:field="*{voltageGrade}" class="form-control" type="text">-->
					<select id="voltageGrade" class="form-control m-b" name="voltageGrade"  th:with="type=${@dict.getType('voltage_grade')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{voltageGrade}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">目录电价明细类别：</label>
				<div class="col-sm-8">
					<!--<input id="priceDetailType" name="priceDetailType" th:field="*{priceDetailType}" class="form-control" type="text">-->
					<select id="priceDetailType" name="priceDetailType" class="form-control m-b"   th:with="type=${@dict.getType('price_detail_type')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{priceDetailType}"></option>
					</select>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "service/basics"
		$("#form-basics-edit").validate({
			rules:{
				name:{
					required:true,
				},
                resultDate:{
                    required:true,
                },
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-basics-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
